import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:my_flutter_test/pages/loginPage.dart';
import 'package:my_flutter_test/pages/registerPage.dart';

class RegOrLogPage extends StatelessWidget {
  const RegOrLogPage({super.key});

  @override
  Widget build(BuildContext context) {
    return DefaultTabController(
      length: 2,
      child: Scaffold(
        appBar: AppBar(
          title: const Text("注册/登录"),
          bottom: const TabBar(
            tabs: [Tab(text: "注册"), Tab(text: "登录",)],
          ),
        ),
        body: TabBarView(
          //构建
          children: [
            RegisterPage(),
            LoginPage(),
          ]
        ),
      ),
    );
  }
}
